<?php
class group extends db
{
    public function index()
    {
        $this->usershell();

        $unit_arr = $this->get_unit();

        foreach ($unit_arr as $value) 
        {
            $data[$value['member_cname']] = $this->get_member_by_one_unit($value['member_id'],1);
        }
//        print_r($data);exit;
        if(!empty($_REQUEST['main_sub']))
        {
            $cha_rs = $this->change_userinfo();
            switch ($cha_rs) 
            {
                case TRUE:
                    echo "<script>alert('修改成功')</script>";
                    break;
                case FALSE:
                    echo "<script>alert('修改失败')</script>";
                    break;
            }
        }
        
        $this->assign("unit_table",$data);
        
        $this->assign("title","管理界面");
        
        $this->assign("sex",array('女','男'));
        
        $this->display("group.tpl");
    }
}
?>
